﻿using Microsoft.EntityFrameworkCore;
using Super.Hmi.Entities;

namespace Super.Hmi.EFCore
{
    public class SuperDataBaseDbContext : DbContext
    {
        public SuperDataBaseDbContext(DbContextOptions<SuperDataBaseDbContext> options) : base(options) { }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<UserEntity>().HasIndex(u => u.UserName).IsUnique();
        }

        public DbSet<UserEntity> Users { get; set; }  // 用户表
    }
}
